<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <meta name="renderer" content="webkit">
    <title></title>
    <link rel="stylesheet" href="/css/pintuer.css">
    <link rel="stylesheet" href="/css/admin.css">
    <script src="/js/jquery.js"></script>
    <script src="/js/pintuer.js"></script>
    <script src="/js/vuejs-2.5.16.js"></script>
    <script src="/js/axios-0.18.0.js"></script>
    <!-- 引入样式 -->
    <link rel="stylesheet" href="/element-ui/lib/theme-chalk/index.css">
    <!-- 引入组件库 -->
    <script src="/element-ui/lib/index.js"></script>


</head>
<body>
<div class="panel admin-panel" id="moviesListDiv">
    <div class="panel-head"><strong class="icon-reorder"> 试卷列表</strong> <a href="" style="float:right; display:none;">添加字段</a>
    </div>
    <div class="padding border-bottom">
        <!--<form>
            <ul class="search" style="padding-left:10px;">
                <li><a class="button border-main icon-plus-square-o" href="/movies_add.html"> 添加试卷</a></li>
            </ul>
        </form>-->
    </div>
    <table class="table table-hover text-center">
        <tr>
            <th width="5%">序号</th>
            <th width="5%">问卷id</th>
            <th>问卷名称</th>
            <th width="10%">封面</th>
            <th>级别</th>
            <th>星级 </th>
            <th width="310">操作</th>
        </tr>

        <tr v-for="(questionnaire,index) in pageInfo.items">
            <td style="text-align:left; padding-left:20px;">{{index + 1 + (pageInfo.page - 1) * pageInfo.pagesize}}</td>
            <td>{{questionnaire.id}}</td>
            <td>{{questionnaire.name}}</td>
            <td width="10%"><img :src="questionnaire.cover" alt="" width="70" height="50"/></td>
            <td>{{questionnaire.level}}</td>
            <td>{{questionnaire.star}}</td>
            <td>
                <div class="button-group">
                    <a class="button border-main" :href="'question_list.html?level=' + questionnaire.level"><span class="icon-edit"></span>查看</a>
<!--                    <a class="button border-main" href="question_list.html"><span class="icon-edit"></span>查看</a>-->
                </div>
            </td>
        </tr>



        <tr>
            <td colspan="7" style="text-align:left;padding-left:20px;">
<!--                <a href="javascript:void(0)" class="button border-red icon-trash-o" style="padding:5px 15px;" @click="deleteAll()"> 批量删除</a>-->
                <span>总记录数：{{pageInfo.counts}}</span>
            </td>
        </tr>
        <tr>
            <td colspan="8">
                <div class="pagelist">
                    <a href="javascript:" @click="changePage(1)">首页</a>
                    <a href="javascript:" @click="(pageInfo.page - 1) <= 0 ? changePage(1) : changePage(pageInfo.page - 1)">上一页</a>
                    <!--<a href="javascript:" class="current" v-for="(item,index) in pageInfo.navigatepageNums"  @click="changePage(item)">{{item}}</a>-->
                    <a href="javascript:" @click="changePage((pageInfo.page + 1) >= pageInfo.pages ? pages : (pageInfo.page + 1))">下一页</a>
                    <a href="javascript:" @click="changePage(pageInfo.pages)">末页</a>
                </div>
            </td>
        </tr>
    </table>
</div>
<script type="text/javascript">
    const app = new Vue({
        el: '#moviesListDiv',
        data: {
            pageInfo: {},
            pageNumber: 1,
            pageSize: 5,
            ids:[]
        },
        methods: {

            findList(){

                axios.get("/soul",{params : {
                        pageNumber: this.pageNumber,
                        pageSize: this.pageSize,
                    }}).then(resp =>{
                    this.pageInfo = resp.data
                    console.log(this.pageInfo);
                })
            },

            changePage(pageNumber){
                this.pageNumber = pageNumber;
                this.findList()
            },

        },
        created(){

            this.findList()
        },
    })
</script>
<script src="/js/verify.js"></script>
</body>
</html>